Search engines are computer software programs that allow users to search for files (e.g., web pages, documents, etc.). Search engines commonly search the world wide web, although search engines are applicable to other domains. Typically, a search engine works by sending out a spider to fetch files. Another program, called an indexer, then reads these files and creates an index based on key words contained in each file. The index thus contains a list of keywords, each of which identifies a file.
A search engine responds to a search query by producing a result set, which may contain thousands or even millions of files. Search engines rank the relevance of files in the result set, such that files that are expected to be the most relevant to the user's search query are presented to the user first. Search engines may be quite effective at returning meaningful results when the files are web pages. However, a drawback with typical search engines is that they are not effective for searching for information within computer programs.
A reason why search engines are not effective at searching for computer programs is that the terms in computer programs have a special meaning depending upon how they are used in the program. For example, each computer language has a set of semantics that defines how symbols are defined in the language. As a particular example, for the semantics of first computer programming language, an integer variable is defined in a program by using the reserved term “INT” followed by a user chosen symbol for the integer. To define an integer, the semantics of another program may require the reserved term “INTEGER” followed by the user chosen symbol for the integer.
Because a typical search engine does not understand the semantic meaning of symbol definitions in the computer program, the search engine cannot effectively search through computer programs. For example, a typical search engine cannot effectively search for occurrences of where a given symbol is defined in a group of computer programs. Because typical search engines look for keywords, the search results are likely to be over-inclusive in that the search results contain occurrences of the symbol other than where the symbol is being defined in the program. Moreover, a typical search engine would not rank the results properly. Search engines also fail to return meaningful results when the search criteria are based on something other than symbol definitions. For example, typical search engines do not understand when a symbol is being referenced in a program.
Because of these and potentially other drawbacks, this approach does not provide wholly satisfactory results. Consequently, an improved method and system for searching for computer programs is desired.